package com.whu.waterworks.dao;
// default package

import java.util.List;

import com.whu.waterworks.model.Historydata;
import com.whu.waterworks.model.HistorydataId;

/**
 * Interface for THistorydataDAO.
 * 
 * @author MyEclipse Persistence Tools
 */

public interface HistorydataDAO {

	public boolean save(Historydata entity);

	/**
	 * Delete a persistent THistorydata entity. This operation must be performed
	 * within the a database transaction context for the entity's data to be
	 * permanently deleted from the persistence store, i.e., database. This
	 * method uses the {@link javax.persistence.EntityManager#remove(Object)
	 * EntityManager#delete} operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * ITHistorydataDAO.delete(entity);
	 * EntityManagerHelper.commit();
	 * entity = null;
	 * </pre>
	 * 
	 * @param entity
	 *            THistorydata entity to delete
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public boolean delete(Historydata entity);

	/**
	 * 更新数据库
	 * @author wangying
	 * @param entity
	 * @return
	 */
	public boolean update(Historydata entity);

	public Historydata findById(HistorydataId id);

	/**
	 * Find all THistorydata entities with a specific property value.
	 * 
	 * @param propertyName
	 *            the name of the THistorydata property to query
	 * @param value
	 *            the property value to match
	 * @return List<THistorydata> found by query
	 */
	public List<Historydata> findByProperty(String propertyName, Object value);

	public List<Historydata> findByValue(Object value);

	/**
	 * Find all THistorydata entities.
	 * 
	 * @return List<THistorydata> all THistorydata entities
	 */
	public List<Historydata> findAll();
	
	/**
	 * 得到指定id的指定类型数据
	 * @author wangying
	 * @param id
	 * @param type
	 * @return
	 */
	public List<Historydata> findByIdAll(String id,String type);
	
	/**
	 * 获取指定id在指定时间内的指定类型数据
	 * @author wangying
	 * @param id
	 * @param type
	 * @param endTime
	 * @param beginTime
	 * @return
	 */
	public List<Historydata> findByIdAllInTime(String id, String type, String endTime, String beginTime);
	
	/**
	 * 获取指定id在某个时间之后的指定类型数据
	 * @author wangying
	 * @param id
	 * @param type
	 * @param beginTime
	 * @return
	 */
	public List<Historydata> findByIdAllTime(String id, String type,String beginTime);
}